package com.future.hedongjun.mine.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.dl7.player.media.IjkPlayerView;
import com.future.hedongjun.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class FreeVideoActivity extends AppCompatActivity {
    @BindView(R.id.Ijk_detailPlayer)
    IjkPlayerView IjkDetailPlayer;
    private String vod_url;
    private String vod_name;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_free_video);
        ButterKnife.bind(this);
        vod_url = getIntent().getStringExtra("VideoUrl");
        vod_name = getIntent().getStringExtra("VideoName");
        //视频播放器初始化
        initIjkVideo();
    }

    private void initIjkVideo() {
        IjkDetailPlayer.init()              // Initialize, the first to use
                .setTitle(vod_name)    // set title
                .setSkipTip(1000 * 60 * 1)  // set the position you want to skip
                .enableOrientation()    // enable orientation
                .setVideoPath(vod_url)    // set video url
                .alwaysFullScreen()            // 固定全屏
                .start();
    }
}
